home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
FGETCHAR.C
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1991-08-05
|
324 b
|
16 lines
/* fgetchar.c */
#include <stdio.h>
main()
{
int i, c;
char buffer[81];
printf("Enter a line (end with a return):\n");
c= fgetchar();
for (i=0; (i<80) && (c != '\n'); i++)
{
buffer[i] = c;
c= fgetchar();
}
buffer[i] = '\0'; /* Make a C-style string */
printf("You entered: %s\n", buffer);
}